package Translate;

import com.baidu.translate.demo.TransApi;

public class Main {

    // 在平台申请的APP_ID 详见 http://api.fanyi.baidu.com/api/trans/product/desktop?req=developer
    private static final String APP_ID = "20211206001020689";
    private static final String SECURITY_KEY = "TsiWIo2_gbCoOnfTCUu7";

    public static String trans(String s) {
        TransApi api = new TransApi(APP_ID, SECURITY_KEY);
        String str = api.getTransResult(s, "auto", "en");
        return str;
    }
}
